package com.party.admin.task;

import com.party.core.service.mall.biz.MallDataBizService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Description: 商城数据矫正
 * @Author: yangshoukun
 * @Date: 2018/5/23 18:30
 */
@Component("quartzMallDataRevise")
public class QuartzMallDataRevise {

    private static Logger logger = LoggerFactory.getLogger(QuartzMallDataRevise.class);

    @Autowired
    private MallDataBizService mallDataBizService;

    /**
     * 矫正昨天的商城数据统计
     */
    public void reviseYesterday() {
        try {
            logger.debug("矫正昨天的商城数据统计----开始");
            mallDataBizService.reviseYesterday();
            mallDataBizService.initDataCount();
            logger.debug("矫正昨天的商城数据统计----结束");
        } catch (Exception e) {
            logger.error("矫正昨天商城数据统计异常", e);
        }
    }

    /**
     * 矫正今天的商城数据统计
     */
    public void reviseToday() {
        try {
            logger.debug("矫正今天的商城数据统计----开始");
            mallDataBizService.reviseToday();
            mallDataBizService.initDataCount();
            logger.debug("矫正今天的商城数据统计----结束");
        } catch (Exception e) {
            logger.error("矫正今天商城数据统计异常", e);
        }
    }
}
